<fieldset>
	<legend><?php echo T_('Website Settings - Currencies')?></legend>	

<?php echo form_open($this->curl . '/'. $this->uri->segment(2) .'/')?>
<?php echo form_hidden('func', $this->uri->segment(2))?>
  
<table width="100%" border="0" cellpadding="3" cellspacing="0" id="grid" class="display">
<thead>
<tr>
    <th class="t-center" style="width:20px"><?php echo T_('on/off')?></th>
    <th><?php echo T_('Currency')?></th>
    <th><?php echo T_('NZD per Unit')?></th>
    <th><?php echo T_('Unit per NZD')?></th>
    <th></th>
</tr>
</thead>
<tbody>
<?php if(!empty($list)):?>
<?php 
	$i = 1;
	$list = (object)$list;
	
	foreach ($list as $row) {
?>			
<tr id="tr_<?php echo $row->currency_id?>">
	<td class="t-center"><?php echo form_checkbox('chbx_published', $row->id, $row->status, 'onChange="save_checkbox('.$row->id.')"'); ?></td>
	<td><?php echo $row->sign?></td>
	<td class="t-right"><?php echo numberFormat($row->exchange_rate, 6) ?></td>
	<td class="t-right">
		<?php 
			if ($row->exchange_rate)
			{
				echo numberFormat(1/$row->exchange_rate, 6);	
			}			
		?>
	</td>
	<td align="center"><?php echo anchor('/settings/edit_currency/'.$row->id, T_('Edit'))?></td>
</tr>
<?php } ?>
<?php endif;?>
</tbody>
</table>	

<?php if(!empty($list)):?>
<table cellspacing="0" cellpadding="3" border="0" width="100%" class="nostyle">
<tr>
	<td><hr></td>
</tr>
<tr>
	<td align="right">
		<input type="button" id="btn_save" class="input-submit" value="Add Currency" name="create" onclick='location="/admin/settings/create_currency/"';">
	</td>
</tr>
</table>
<?php endif;?>
<?php echo form_close()?>

</fieldset>

<script type="text/javascript" charset="utf-8">
var oTable;

$(document).ready(function() {										
	/* Init DataTables */
	oTable = $('#grid').dataTable(
	{
		"aaSorting": [[ 1, "asc" ]],				
		"aoColumns": [
			{ "bSortable": false },
			null,
			null,
			null,
			{ "bSortable": false },
		],
															
		"bPaginate": true,
		"bLengthChange": true,
		"bFilter": true,
		"bSort": true,
		"bInfo": true,
		"bAutoWidth": true
	});
});
</script>